<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions" xml:lang="en"
	lang="en">

	<head>
		<title>My Facelets Page</title>
		<meta http-equiv="keywords" content="enter,your,keywords,here" />
		<meta http-equiv="description"
			content="A short description of this page." />
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<!--<link rel="stylesheet" type="text/css" href="styles.css">-->
		<link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/main.css" media="screen"></link>
		<link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/css.css"></link>
		<link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/work.css"></link>
		<link href="../css/public.css" rel="stylesheet" type="text/css" media="screen"/>
		<link href="../css/ui-lightness/jquery-ui-1.7.2.custom.css" type="text/css" rel="stylesheet" />	
		<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="../js/jquery-ui-1.7.2.custom.min.js"></script>
		<!-- menu -->
		<script type="text/javascript">
			jQuery.noConflict();//与JSF搭配需要这句话，不然会有冲突
			jQuery(document).ready(function(){
				jQuery("#left").accordion({ header: "h3" });	
			});	
			//导航菜单高量显示	 
			//<![CDATA[  
				function sel(obj)
				{
					var menu_top;
					if(obj.id=="home_0"||obj.id=="home_1"){
						menu_top="home";
					}
					else{
						menu_top=obj.id.substring(5);
					}
					//alert(menu_top)
					var lis=parent.topFrame.document.getElementsByTagName("li");
					//alert(lis.length);
					for(var i=0;i<lis.length;i++)
					{
						//alert(lis[i].id);
						if(obj!="home_0"&&obj!="home_1"){
							menu_top=replaceStr(menu_top,"Add","Management");
						}
						//alert(lis[i].id);
						lis[i].style.background="";
						if(lis[i].id==menu_top)
						{
						lis[i].style.background="#00f";//#f3c3f3; #00f
						}
					}
				}
				/**  
				 **将所有的字符串fromStr替换成toStr  
				 */  
				 function replaceStr(mainstr,fromStr,toStr){   
				   //第二个参数中的 g 表示全部匹配,i表示忽略大小写   
				  //var reg = new RegExp("test","gi");   
				  var reg = new RegExp(fromStr,"g");   
				  var result=mainstr.replace(reg,toStr);   
				  ///alert(result); //全部替换   
				  return result;   
				 }  
			//]]> 
		</script>
		<!-- news -->
		<script type="text/javascript" src="../js/scroll.js"></script>
		<script >
			//控制浏览后的显示颜色
			function changecolor(obj){
				if(null != obj){
					obj.style.color = "#FF0000";
				}
			}
			function refresh(){
				var o=Math.random();			
				window.parent.frames["notice"].location.href="../template/left_notice.faces?random="+o; 
			}
		    function displayDiv(hintid){
				if(document.getElementById("idScroller").style.display==''){
					var valuehidden = document.getElementById(hintid);
					var value1 = document.all["a:display"].value = valuehidden.value;
				   	document.getElementById("display1").style.display="";
					document.getElementById("idScrollMid").style.display="none";
					document.getElementById("important").style.display="none";
				    document.getElementById("idScroller").style.display="none";
				    document.getElementById("return").style.display="";
				}
			}
		</script>
   </head>
	<body>
	<f:view>
		<div id="news" style="position: relative;top:-5px;">
			<h:form id="a">
			<div id="return" style="display: none;">
				<img style="cursor: hand"  onclick="hiddenDiv()" src="${facesContext.externalContext.requestContextPath}/images/return.gif"></img>
			</div>
                <div id="important" style="display: '';" >
              
				</div>
				<div id="idScroller"
					style="display: ''; width: 210px; height: 126px; overflow: hidden;" class="Scroller">
					<div id="idScrollMid">
					<a4j:outputPanel id="hintPanel">
					<ui:repeat value="#{NoticeBB.scroll_notice_list}" var="notice" id="repeat01">
								<img src="../images/0002.jpg" />
								<h:outputLabel value="#{notice.tpTitle}"
									id="link_id"
									onclick="displayDiv('#{notice.tpNoticeid}');changecolor(this);"
									style="white-space:nowrap;cursor: hand;line-height:20px; font-size:12px;"></h:outputLabel><br/>
						 		<input type="hidden" name="function" value="#{notice.tpCont}" id="#{notice.tpNoticeid}"/>
					  </ui:repeat>
					  <br/><br/>
					</a4j:outputPanel>
					</div>
				</div>
				<div id="display1" style="display:none;" >
						<h:inputTextarea id="display"   styleClass="display" style="width:210px;height:126px;line-height:20px;font-size:12px;"></h:inputTextarea>
				</div>
				</h:form>
				<h:form id="pollForm">
				<a4j:poll interval="300000" oncomplete="refresh()"></a4j:poll>
		  </h:form>
		</div>
		</f:view>
	</body>
</html>
